Longest Common Subsequence Algorithm Visualization
-
Pseudo Code
- for (var i = 1; i <= text2.length; i++)
- for (var j = 1; j <= text1.length; j++)
- if (text1[j - 1] == text2[i - 1])
- DP[i][j] =
DP[i - 1][j - 1] + 1;
- else
- DP[i][j]
= max(DP[i - 1][j], DP[i][j - 1]);